/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-06 11:10:58
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-06 15:18:34
 */
import React from 'react'
import Son from './Son'

class Lcom extends React.Component {
  state = {
    n: 1,
  }
  handle = () => {
    this.setState(() => {
      return {
        n: 1,
      }
    })
  }

  render() {
    console.log(this, 666)
    return (
      <div>
        御剑乘风来,除魔天地间!===Lcom.js======={this.state.n}===
        <button onClick={() => this.handle()}>钩子函数</button>====
        <button onClick={() => clearInterval(this.timeId)}>清除定时器</button>
        ====
        <Son s1={this.state.n}></Son>
      </div>
    )
  }

  componentDidMount() {
    this.timeId = setInterval(() => {
      // this.handle()
    }, 1000)
  }
}
export default Lcom
